<?php

#region 应用配置相关

/**
 * 应用配置相关
 * */
$config["app"] = array(
    /**
     * 集合uri的前缀
     */
    'baseUri' => '/',
    /**
     * 是否启动SQL日志
     * 如果设置为1，则会记录执行的SQL日志。
     * 如果设置为0，则不会记录相关日志。
     */
    'enableSqlLog' => 1,
    /**
     * 是否启动数据库性能分析
     * 如果设置为1，则会对SQL的执行操作进行分析，并且记录。
     * 如果设置为0，则不会记录相关日志。
     */
    'enableDbProfiler' => 1
);

#endregion

#region 相关命名空间

/**
 * 相关命名空间
 */
$config["namespaces"] = array(
    'App\Acl' => APP_PATH . '/app/acl/',
    'App\Adapters' => APP_PATH . '/app/adapters/',
    'App\Adapters\Annotations' => APP_PATH . '/app/adapters/annotations',
    'App\Cache' => APP_PATH . '/app/cache/',
    'App\Channels' => APP_PATH . '/app/channels/',
    'App\Enums' => APP_PATH . '/app/enums/',
    'App\Exceptions' => APP_PATH . '/app/exceptions/',
    'App\Filters' => APP_PATH . '/app/filters/',
    'App\Helpers' => APP_PATH . '/app/helpers/',
    'App\Http' => APP_PATH . '/app/http/',
    'App\Interfaces' => APP_PATH . '/app/interfaces/',
    'App\Interfaces\Strategies' => APP_PATH . '/app/interfaces/strategies/',
    'App\Libraries' => APP_PATH . '/app/libraries/',
    'App\Libraries\ALiYun' => APP_PATH . '/app/libraries/aliyun/',
    'App\Libraries\Excel' => APP_PATH . '/app/libraries/excel/',
    'App\Libraries\Log' => APP_PATH . '/app/libraries/log/',
    'App\Libraries\NoSql' => APP_PATH . '/app/libraries/nosql/',
    'App\Libraries\NoSql\Mongodb' => APP_PATH . '/app/libraries/nosql/mongodb/',
    'App\Libraries\NoSql\Mongo' => APP_PATH . '/app/libraries/nosql/mongo/',
    'App\Libraries\RDBS' => APP_PATH . '/app/libraries/rdbs/',
    'App\Libraries\SMS' => APP_PATH . '/app/libraries/sms/',
    'App\Libraries\Social' => APP_PATH . '/app/libraries/social/',
    'App\Libraries\WeChatPay' => APP_PATH . '/app/libraries/weChatPay/',
    'App\Libraries\WeChatPay\Data' => APP_PATH . '/app/libraries/weChatPay/data/',
    'App\Libraries\WeChatPay\Unit' => APP_PATH . '/app/libraries/weChatPay/unit/',
    'App\Listeners' => APP_PATH . '/app/listeners/',
    'App\Mvc' => APP_PATH . '/app/mvc/',
    'App\Plugins' => APP_PATH . '/app/plugins/',
    'App\Plugins\Dispatch' => APP_PATH . '/app/plugins/dispatch/',
    'App\Queue' => APP_PATH . '/app/queue/',
    'App\Services' => APP_PATH . '/app/services/',
    'App\Strategies' => APP_PATH . '/app/strategies/',
    'JPush' => APP_PATH . '/app/libraries/jPush/',
    'JPush\Exceptions' => APP_PATH . '/app/libraries/jPush/exceptions'
);

#endregion

#region Http Code

$config["httpCode"] = array(
    "200" => "OK",
    "400" => "Bad Request",
    "401" => "401 Unauthorized",
    "402" => "Unauthorized Access",
    "404" => "Not Found",
    "405" => "Method Not Allowed",
    "500" => "Internal Server Error",
);

#endregion

#region 系统响应消息语言版本地址

$config["lang"] = "zh_cn";

#endregion


#region 模块相关命名空间

/**
 * 模块相关命名空间
 */
$config["module"] = array(
    /*注册信息*/
    "register" => array(
        'v1' => array(
            'className' => 'App\V1\Module',
            'path' => APP_PATH . '/app/modules/v1/Module.php'
        ),
        'v1_0_1' => array(
            'className' => 'App\V1_0_1\Module',
            'path' => APP_PATH . '/app/modules/v1.0.1/Module.php'
        )
    ),
    /*模块v2 加载信息*/
    "v1" => array(
        "namespaces" => array(
            'App\V1\Controllers' => APP_PATH . '/app/modules/v1/controllers/',
            'App\V1\Models\RDBS' => APP_PATH . '/app/modules/v1/models/rdbs/',
            'App\V1\Models\NoSql' => APP_PATH . '/app/modules/v1/models/nosql/',
            'App\V1\Repositories' => APP_PATH . '/app/modules/v1/repositories/'
        ),
        // 视图目录地址
        'views' => ""
    ),
    "v1_0_1" => array(
        "namespaces" => array(
            'App\V1_0_1\Controllers' => APP_PATH . '/app/modules/v1.0.1/controllers/',
            'App\V1_0_1\Models\RDBS' => APP_PATH . '/app/modules/v1.0.1/models/rdbs/',
            'App\V1_0_1\Models\NoSql' => APP_PATH . '/app/modules/v1.0.1/models/nosql/',
            'App\V1_0_1\Repositories' => APP_PATH . '/app/modules/v1.0.1/repositories/'
        ),
        // 视图目录地址
        'views' => ""
    )
);

#endregion


// 加载环境配置
include APP_PATH . "/app/config/env.php";

return new \Phalcon\Config($config);
